package p2psvideo;
import p2psvideo.aidl.OnVideoSizeChangedListener;
import p2psvideo.aidl.OnFileDownloadCreatedListener;
import p2psvideo.aidl.OnFileDownloadFailedListener;
import p2psvideo.aidl.OnFileListChangedListener;
import p2psvideo.aidl.OnFileDownloadProgressListener;
import p2psvideo.aidl.OnBufferingUpdateListener;
import p2psvideo.aidl.OnFileDownloadFinishedListener;
import p2psvideo.aidl.OnHttpResponse;
import p2pproxy.FileTimeInfo;

interface IP2PSRemote {	
	boolean beginPlay(String type);
	boolean usingRaw();
	void	setSurface(in Surface surface); 
	boolean 	isEof();	
	int getRawTime();
	boolean rawBufferring();
	long getRawBufferLength();
	String getSupportedVideoCodecList();
	boolean addFile(String urls, String streamers, String opts, int start, int duration, int index, int format);	
	boolean removeFile(int index);	
	int fileCount();
	void clear();
	boolean fileReady(int index);
	boolean error();
	boolean ready();	
	int port();
	void play();
	void pause();
	boolean seek(int t);
	boolean seekToKeyFrame(int t);
	boolean seekByTimeCode(double tc, boolean keyFrameAcuracy, boolean mustMatch, boolean asc);
	FileTimeInfo getFileTimeInfo(int idx);
	boolean stopped();
	int duration();
	boolean isLive();			
	boolean noSignal();
	String getStatus();	
	int getOutSidePlayerStreamTime(int outsideTime);
	double getOutSidePlayerTimeCode(int outsideTime);
	int inTimeShiftMode();
	boolean bufferring();
	void setOnVideoSizeChangedListener(OnVideoSizeChangedListener l);
	void setOnBufferingUpdateListener(OnBufferingUpdateListener l);
	String getCurrentPlayVsid();
	void endPlay();	
	
	void setAllowP2P(boolean allow);
	boolean getAllowP2P();
	boolean existsFile(String vsid);
	boolean removeFileByID(String vsid);
	void setOnFileListChangedListener(OnFileListChangedListener l);
	void setOnFileDownloadProgressListener(OnFileDownloadProgressListener l);
	void setOnFileDownloadFinishedListener(OnFileDownloadFinishedListener l);
	String getFiles();	
	String getCacheRoots();	
	boolean removeCacheRoot(String root, boolean removeVideo);
	boolean addCacheRoot(String root, boolean resetP2P);
	boolean cacheSpaceTooSmall();
	String getFileInfo(String vsid);	
	void setMaxDownload(int maxDownloads);	
	int getMaxDownloads();	
	void allowDownload(int allow, boolean background);
	int getAllowDownload();
	boolean getAllowDownloadBackground();
	boolean isCurrentAllowDownload();
	boolean createDownload(String urls, String streamers, String opts, int type, int format, OnFileDownloadCreatedListener onCreate, OnFileDownloadFailedListener onFailed);	
	boolean setDownloadType(String vsid, int type, boolean downloadImd);
	boolean enableLocalStorage(boolean enable, boolean inAppStorage);
	void setBackground(boolean back);
	void startPullEvents();
	void stopPullEvents();
	
	void readHttpRtmfpFile(String httpUrls, String rtmfpUrls, String filePath, OnHttpResponse cb);
	int getProxyPort();
}
